package main

import "fmt"

type Student struct {
	id int
	age int
}

func main() {
	var s Student
	s.age = 1
	test(s)
	fmt.Println(s)
	test2(&s)
	fmt.Println(s)
}

// struct 值传递
func test(s Student)  {
	s.age = 2
}

// struct 地址传递
func test2(s *Student){
	s.age = 3
}